package com.chen.service.impl;

import com.chen.dao.SalesmanDao;
import com.chen.model.Salesman;
import com.chen.service.SalesmanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("salesmanService")
public class SalesmanServiceImpl implements SalesmanService {

    @Resource
    private SalesmanDao salesmanDao;

    @Override
    public int addSalesman(Salesman salesman) {
        return salesmanDao.addSalesman(salesman);
    }

    @Override
    public List<Salesman> findAllSalesman() {
        return salesmanDao.findAllSalesman();
    }

    @Override
    public int updateSalesman(Salesman salesman) {
        return salesmanDao.updateSalesman(salesman);
    }

    @Override
    public Salesman findSalesmanById(Integer salesman_id) {
        return salesmanDao.findSalesmanById(salesman_id);
    }

    @Override
    public List<Salesman> findSalesmanByName(String salesman_name) {
        return salesmanDao.findSalesmanByName(salesman_name);
    }
}
